package com.mc.designpattern.template;

/**
 * @author fumengchao
 * @ClassName abstractLog.java
 * @Description 抽象类
 * @createTime 2021 0722 11:41:00
 */
public abstract class AbstractLog {
    private String name;
    private boolean enabled=true;

    public AbstractLog() {
    }

    public AbstractLog(String name, boolean enabled) {
        this.name = name;
        this.enabled = enabled;
    }

    public void log(String msg) {
        if (enabled) {
            doLog(msg);
        }
    }

    protected abstract void doLog(String message);
}